package top.hebao.mybatis.service.impl;

import top.hebao.mybatis.dao.StudentDao;
import top.hebao.mybatis.domain.Student;
import top.hebao.mybatis.service.StudentService;
import top.hebao.mybatis.util.SqlSessionUtil;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private final StudentDao dao = SqlSessionUtil.getSession().getMapper(StudentDao.class);
    @Override
    public void save(Student s) {
        dao.save(s);
    }

    @Override
    public List<Student> selectAll() {
        return dao.selectAll();
    }

    @Override
    public List<Student> selectById(String id) {
        return dao.selectById(id);
    }
}
